/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1617369719745_846';

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };
  config.mysql = {
    // database configuration
    client: {
      host: 'localhost',
      //host: '47.106.250.206',
      // port
      port: '3306',
      // username
      user: 'root',
      password: 'root',
      //password: 'KpuuqswlqD#7vu^W@FVANg^OxsX1Ry',
       database: 'blog_zm',
      //database: 'vue-blog',
    },
    // load into app, default is open
    app: true,
    // load into agent, default is close
    agent: false
  };
  config.cors = {
    origin: 'http://localhost:9999',
    credentials:true,//允许cooick可以跨域
    allowMethods:'GET,HEAD,PUT,POST,UPDATE,DELETE,PATCH,OPTIONS'
  };
  config.security = {
    csrf: {
      enable: false,
    }
  };
  return {
    ...config,
    ...userConfig,
  };
};
